<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            width: 100px;
            height: 100px;
        }

        .box1 {
            background-color: blue;
            /* 设置压盖优先级,z-index默认为0 */
            z-index: 1;
        }

        .box2 {
            background-color: red;
            left: 50px;
            top: 50px;
        }
    </style>
</head>
<body>
    <div class="box1">box1</div>
    <div class="box2">box2</div>
</body>
</html>